package com.dream.technology.components.expresion;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 描述：根据field data type 选择合适的表达式解析器
 *
 * 数据类型 1 数字类型 2 Boolean 3 select 4 多选 5 时间 6 字符串
 * @author chen_q_i@163.com
 * 2019/1/3 : 15:22.
 * @version : 1.0
 */
@Component("riskExpressionAnaMatcher")
public class RiskExpressionAnaMatcher {

    @Autowired
    private Map<String,ExpressionService> expressionServices;

    private String[] arr = {"riskNumberExpressionAnalysis","booleanExpressionAnalysis","radioExpressionAnalysis",
            "checkboxExpressionAnalysis","datetimeExpressionAnalysis","stringExpressionAnalysis"};
    public ExpressionService getExpressionServices(Integer dataType) {
        ExpressionService expressionService = expressionServices.get(arr[dataType - 1]);
        return expressionService;
    }
}
